import requests

url = 'http://www.baidu.com/'

headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) '
                      'Chrome/123.0.0.0 Safari/537.36'
    }

data = {
    'wd': 'ip'
}

proxies = {
    'http': '222.66.202.6:8888'
}

# url 请求资源路径
# params 参数
# kwargs 字典
response = requests.get(url, headers=headers, proxies=proxies)

content = response.text

with open('ip.html', 'w', encoding='utf-8') as f:
    f.write(content)


